﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Common
{
    public class ActionParameter
    {
        public string AnimationName = string.Empty;
        public bool Grounded = false;
        public byte Index = 0;
        public string AssName;
        public ActionParameter(string assName, string aName, bool grounded, byte index)
        {
            AssName = assName;
            AnimationName = aName;
            Grounded = grounded;
            Index = index;
        }
        public static ActionBase GetAction(ActionParameter para)
        {
            ActionBase result = null;
            Type type = Type.GetType(para.AssName);
            if (type == null) throw new Exception("ActionConfig:GetAction(ActionParameter para) Can't find type:" + para.AssName);
            result = Activator.CreateInstance(Type.GetType(para.AssName)) as ActionBase;
            result.Parameter = para;
            return result;
        }
    }
}

